<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>个人资料</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=0.5, maximum-scale=2.0, user-scalable=yes" />
<link href="{lanrain::RES}/css/userinfo/fans.css" rel="stylesheet" type="text/css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
</head>
<body id="fans" >
<div class="qiandaobanner"> <img src="{lanrain:$homepic}" > </div>
<div class="cardexplain">
<li class="nob">
<div class="beizhu"><if condition="$info['wechaname'] neq false">以下信息将作为消费凭证，请认真填写！<else/>填写以下信息即可领取vip会员卡</if></div>
</li>
<ul class="round">
<li>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="kuang">
<tr>
<th>微信名称</th>
<td><input name="wechaname"  type="text" class="px" id="wechaname" value="{lanrain:$info.wechaname}" placeholder="请输入您的微信名称"></td>
</tr>
</table>
</li>
<li>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="kuang">
<tr>
<th>真实姓名</th>
<td><input name="truename"  type="text" class="px" id="truename" value="{lanrain:$info.truename}" placeholder="请输入您的真实姓名"></td>
</tr>
</table>
</li>
<li>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="kuang">
<tr>
<th>手机号码</th>
<td><input name="tel"  class="px" id="tel" value="{lanrain:$info.tel}"  type="text" placeholder="请输入您的电话"></td>
</tr>
</table>
</li>
<li>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="kuang">
<tr>
<th>QQ号码</th>
<td><input name="qq"  class="px" id="qq" value="{lanrain:$info.qq}"  type="text" placeholder="请输入您的QQ号码"></td>
</tr>
</table>
</li>
</ul>
<ul class="round">
<li>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="kuang">
<tr>
<th>性别</th>
<td><select name="sex" class="dropdown-select" id="sex">
<option  class="dropdown-option">请选择你的性别</option>
<option  value="1" <if condition="$info['sex'] eq 1">selected</if>>男</option>
<option  value="2" <if condition="$info['sex'] eq 2">selected</if>> 女</option>
<option  value="0" <if condition="$info['sex'] eq 3">selected</if>>其他</option>
</select></td>
</tr>
</table>
</li>
<li>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="kuang">
<tr>
<th>年龄</th>
<td><input name="age"  type="text" class="px" id="age" value="{lanrain:$info.age}" placeholder="请输入您的年龄"></td>
</tr>
</table>
</li>
</ul>
<div class="beizhu">以上信息将作为发奖凭证，请认真填写！</div>
<div class="footReturn">
<a id="showcard"  class="submit" ><if condition="$info['wechaname'] neq false">保 存<else/>领取会员卡</if></a>
<div class="window" id="windowcenter">
<div id="title" class="wtitle"><span class="close" id="alertclose"></span></div>
<div class="content">
<div id="txt"></div>
</div>
</div>
</div>
<script type="text/javascript"> 
var oLay = document.getElementById("overlay");	
$(document).ready(function () { 

$("#showcard").click(function () {
	if($("#wechaname").val()==''){
		alertdiy('微信帐号必须填写');return false;
	}
	if($("#tel").val()==''){
		alertdiy('手机号码必须填写');return false;
	}
	reg=/^0{0,1}(13[0-9]|145|15[7-9]|153|156|18[0-9])[0-9]{8}$/i;
	  if(!reg.test($("#tel").val())){   
			alertdiy("错误,请输入11位的手机号！");
			return false;
	   }
	var submitData = {
	wechaname: $("#wechaname").val(),
	truename: $("#truename").val(),
	qq: $("#qq").val(),
	sex: $("#sex").val(),
	birthday: $("#birthday").val(),
	tel: $("#tel").val(),
	address: $("#address").val(),
	info: $("#info").val(),
	age: $("#age").val(),
	action: "setTel"
	};
	
	$.post('index.php?g=Wap&m=Userinfo&a=index&token={lanrain:$Think.get.token}&wecha_id={lanrain:$Think.get.wecha_id}', submitData,
	function(data) {
		if(data==1){
			alertdiy('更新成功');
		}else if(data==2){
			alert('成功领取了会员卡');
			location.href = "{lanrain::U('Card/vip',array('token'=>$_GET['token'],'weicha_id'=>$_GET['weicha_id']))}";
		}else if(data==3){
			alertdiy('该商家会员卡缺货了');
		}else{
			alertdiy('服务器繁忙');
		}
		
	})

	}); 
}); 

$("#windowclosebutton").click(function () { 
$("#windowcenter").slideUp(500);
oLay.style.display = "none";

}); 
$("#alertclose").click(function () { 
$("#windowcenter").slideUp(500);
oLay.style.display = "none";

}); 

function alertdiy(title){ 
//var windowHeight; 
//var windowWidth; 
//var popWidth;  
//var popHeight; 
//windowHeight=$(window).height(); 
//windowWidth=$(window).width(); 
//popHeight=$(".window").height(); 
//popWidth=$(".window").width(); 
//var popY=(windowHeight-popHeight)/2; 
//var popX=(windowWidth-popWidth)/2; 
//$("#windowcenter").css("top",popY).css("left",popX).slideToggle("slow"); 
$("#windowcenter").slideToggle("slow"); 
$("#txt").html(title);
//$("#windowcenter").hide("slow"); 
setTimeout('$("#windowcenter").slideUp(500)',4000);
} 
</script>
</div>
</body>
</html>
